package jdbcPool.myJDBCPool;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class TestMyDataSource {
    public static void main(String[] args) throws SQLException {

        MyDateSource myDateSource = new MyDateSource();
        System.out.println(myDateSource.getSize());
        Connection connection = myDateSource.getConnection();

        String sql = "select * from student";
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        ResultSet resultSet = preparedStatement.executeQuery();

        connection.close();
        preparedStatement.close();
        resultSet.close();
        System.out.println(myDateSource.getSize()); //10   归还 成功

    }
}
